#include<iostream>
#include<vector>
#include<cstring>
using namespace std;
vector<int> missingTwo(vector<int>& nums) {
    int m = nums.size() + 2;
    vector<int>path(2, 0);

    vector<int>result;
    for (int i = 1; i <= m ; i++)
        result.push_back(i);

    for (int i = 0; i < nums.size(); i++)
        result.push_back(nums[i]);




    int sz = result.size();
    /*for (int i = 0; i < sz; i++)
    {
        cout << result[i] << " ";
    }*/
   
    int sum = 0;
    for (int i = 0; i < sz; i++)

        sum ^= result[i];

    int count = 1;

    while ((sum & count) == 0)
        count <<= 1;



    for (int i = 0; i < sz; i++)
    {
        if (count & result[i] != 0)
            path[0] ^= result[i];
        else
            path[1] ^= result[i];




    }
    
    return path;





















}
int main()
{
    int arr[1] = { 1 };
    vector<int>nums(arr,arr+1);

    vector<int>res=missingTwo(nums);
    for (auto e : res)
    {
        cout << e;
    }


}
class Solution {
public:
    bool isUnique(string astr) {
        int m = astr.size();
        if (m > 26)return false;
        int bitmap = 0;
        for (auto e : astr)
        {
            int i = e - 'a';
            if ((bitmap >> i) & 1 == 1)return false;
            else bitmap |= 1 << i;


        }
        return true;
    }
}; class Solution {
public:
    int getSum(int a, int b) {


        while (b != 0)
        {
            int x = a ^ b;
            unsigned int carray = (unsigned int)(a & b) << 1;
            a = x;
            b = carray;


        }return a;
    }
}; class Solution {
public:
    int missingNumber(vector<int>& nums) {
        int sum = 0;
        for (int i = 0; i <= nums.size(); i++)
            sum ^= i;

        for (int i = 0; i < nums.size(); i++)
            sum ^= nums[i];

        return sum;
    }
}; class Solution {
public:
    vector<int> missingTwo(vector<int>& nums) {
        int m = nums.size() + 2;
        vector<int>path(2, 0);

        vector<int>result;
        for (int i = 1; i <= m; i++)
            result.push_back(i);

        for (int i = 0; i < nums.size(); i++)
            result.push_back(nums[i]);

        int sz = result.size();
        int sum = 0;
        for (int i = 0; i < sz; i++)

            sum ^= result[i];

        int count = 1;

        while ((sum & count) == 0)
            count <<= 1;



        for (int i = 0; i < sz; i++)
        {
            if ((count & result[i]) != 0)
                path[0] ^= result[i];
            else
                path[1] ^= result[i];




        }
        return path;






















    }
}; class Solution {
public:
    string addBinary(string a, string b) {
        int end1 = a.size() - 1;
        int end2 = b.size() - 1;
        int t = 0;
        string result;
        while (end1 >= 0 || end2 >= 0 || t)
        {
            if (end1 >= 0)t += a[end1--] - '0';
            if (end2 >= 0)t += b[end2--] - '0';

            result += t % 2 + '0';
            t /= 2;
        }
        reverse(result.begin(), result.end());
        return result;









    }
}; class Solution {
public:
    bool containsDuplicate(vector<int>& nums) {
        unordered_set<int>hash;
        for (auto x : nums)
        {
            if (hash.count(x))return true;
            else hash.insert(x);




        }
        return false;
    }
}; class Solution {
public:
    int jewelleryValue(vector<vector<int>>& frame) {
        int m = frame.size();
        int n = frame[0].size();
        vector<vector<int>>dp(m + 1, vector<int>(n + 1));


        for (int i = 1; i <= n; i++)
        {
            dp[1][i] = dp[1][i - 1] + frame[0][i - 1];
        }
        for (int i = 1; i <= m; i++)
        {
            dp[i][1] = dp[i - 1][1] + frame[i - 1][0];
        }
        for (int i = 2; i <= m; i++)
        {
            for (int j = 2; j <= n; j++)
            {

                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + frame[i - 1][j - 1];


            }
        }
        int maxp = 0;
        for (int i = 1; i <= m; i++)
        {
            for (int j = 1; j <= n; j++)
            {
                if (dp[i][j] > maxp)
                    maxp = dp[i][j];



            }
        }
        return maxp;












    }
};